package net.pet.util;

import org.jasper.crypto.secret.Encryption3;

public class PWDEncode {
	public static void main(String[] args) {
		String pwd = decode("KCBzWoUDk+bqIhqNFl5GsA==");
		String code = encode("123456");
		System.out.println(code);
		System.out.println(pwd);
//		for (String s : sr.split(",")) {
//			System.out.print(decodeVoucherSn(s));
//			System.out.print("\t-->\t");
//			System.out.println(s);
//		}
	}

	/**
	 * 加密
	 * 
	 * @param userPwd
	 * @return
	 */
	public static String encode(String userPwd) {
		return EncryEncode(userPwd);
	}

	/**
	 * 解密
	 * 
	 * @param userPwd
	 * @return
	 */
	public static String decode(String userPwd) {
		return EncryDecode(userPwd);
	}

	public static String EncryDecode(String userPwd) {
		Encryption3 e = new Encryption3("f-club");
		try {
			String pwd = e.Decode(userPwd);
			return pwd;
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		return null;
	}
	/**
	 * 加密现金�?
	 * @param userPwd
	 * @return
	 */
	public static String encodeVoucherSn(String userPwd) {
		Encryption3 e = new Encryption3("buLcf");
		try {
			String pwd = e.Encode(userPwd);
			return pwd;
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		return null;
	}
	/**
	 * 解密现金�?
	 * @param userPwd
	 * @return
	 */
	public static String decodeVoucherSn(String userPwd) {
		Encryption3 e = new Encryption3("buLcf");
		try {
			String pwd = e.Decode(userPwd);
			return pwd;
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		return null;
	}

	public static String EncryEncode(String userPwd) {
		Encryption3 e = new Encryption3("f-club");
		try {
			String pwd = e.Encode(userPwd);
			return pwd;
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		return null;
	}
}
